<% if @gift.purchase.blank? %>

	<% unless @gift.picture.blank? %>
		<div style="float: left; margin-right: 10px; margin-bottom: 0px;">
			<p><%= image_tag(url_for({:action => 'image', :id => @gift.id})) -%></p><br />
			<span style="font-size: 0.5em; margin-top: 0px;"></span>
		</div>
	<% end %>

	<h1><%= @gift.name %></h1>
	<h3><%= @gift.details %></h3>
	<p><i><%= @gift.comments %></i></p>
	<p>$<%= @gift.price %> <small>from</small> <%= @gift.store %>
		<% if @gift.website.blank? %><small> [This item can only be purchased at the store]</small><% else %><%= link_to '[Buy online now]', @gift.website %><% end %><br /></p>
	<%= button_to "Mark gift as purchased", {:action => :mark_purchased, :id => @gift.id}, :confirm => 'This item will be removed from the list of gifts. Are you sure you want to do this?'  %>

	<div id="address"><p>
	If you prefer to ship your gift, please mail packages to Chap's work at:<br />
		<blockquote>
		Chap Ambrose<br />
		1929 Sansom Street<br />
		Philadelphia, PA 19144<br /></blockquote></p><p>
		Or send letters, cards, and mail slot sized packages to our apartment at:<br />
		<blockquote>
		Chap and Maura Ambrose<br />
		1415 Jackson Street<br />
		Philadelphia, PA 19144
		</blockquote></p>
	</div>

<% else %>
<div id="purchaseshow">
	<% unless @gift.picture.blank? %>
		<%= image_tag(url_for({:action => 'image', :id => @gift.id})) -%>
	<% end %>

	<h1><%= @gift.name %></h1>
	<h2>This gift has already been purchased.</h2>
	<p>Did you mark this gift as purchased accidentally? <%= button_to "Undo Purchase", {:action => :undo_purchased, :id => @gift.id}, :confirm => 'This item will be returned to list of available gifts. Are you sure you want to do this?'  %></p>
</div>
<% end %>

<%= link_to 'Edit', :action => 'edit', :id => @gift %> |
<%= link_to 'Back', :action => 'list' %>
